{% extends "../../_basic.twig" %}

{% block header %}
    <script src="../../../src/aux-dialog/index.js"></script>
    <link rel="stylesheet" href="../../../src/aux-dialog/index.css?v={{random()}}">
    <style>
        .dialog-slider {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translateX(-50%) translateY(-50%);
            z-index: 1000;
        }
    </style>
{% endblock %}

{% block body %}
    <div>          
        <h3>默认</h3>        
        <aux-button id="opendialog">toggle dialog</aux-button>
        <aux-dialog id="dialog">
            <div>haha</div>
        </aux-dialog>
        <script>
            var opendialog = document.getElementById("opendialog");
            opendialog.addEventListener("click", function() {
                var dialog = document.getElementById("dialog");
                dialog.toggle();
            });
        </script>
        <h5>通过aux-dialog-trigger触发</h5>       
        <aux-dialog-trigger for="showbigimage">
            <img src="" alt="缩略图">
        </aux-dialog-trigger>
        <aux-dialog class="dialog-slider" id="showbigimage">
            <div>
                <img src="" alt="全尺寸">
            </div>                        
        </aux-dialog>        
    </div>
{% endblock %}
